package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.impl.ProductUnitServiceImpl;
import com.atguigu.spzx.common.result.Result;
import com.atguigu.spzx.manager.vo.productUnit.ProductUnitQueryRespVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * ProductUnitController
 * </p>
 *
 * @author flyduck
 * @since 2023/10/31
 */
@Api(tags = "商品计量单位管理接口")
@RestController
@RequestMapping("/admin/product/productUnit")
public class ProductUnitController {

    @Autowired
    private ProductUnitServiceImpl productUnitService;

    @ApiOperation("查询所有商品计量单位")
    @GetMapping("/getProductUnitList")
    public Result getProductUnitList(){
        List<ProductUnitQueryRespVo> respVoList = productUnitService.getProductUnitList();
        return Result.ok(respVoList);
    }

}
